Skip to content

AI Core Library

Silverbullet offers the ability to share templates, snippets, etc as Libraries that can be imported. The AICore library is meant to provide helpful utilities around using the silverbullet-ai plug.

Installation

To import this library, edit your SETTINGS page to include this library under the libraries: key like the example below.

libraries:
# You'll most likely already have the normal Silverbullet core library
- import: "[*](!silverbullet.md/Library/Core/*.md)"
# Add the AICore library as well
- import: "[*](!ai.silverbullet.md/Library/AICore/*.md)"

Once added, run the {[Libraries: Update]} command to download the libraries.

The included templates, prompts, and space scripts are briefly described below. Please consider contributing any templates or prompts you find useful.

Included templates and prompts

  • Library/AICore/AIPrompt/AI Create Space Script Describe the space script functionality you want and generate it
  • Library/AICore/AIPrompt/AI Rewrite - Grammar Rewrite current paragraph or selected text to fix and improve grammar.
  • Library/AICore/AIPrompt/AI Rewrite - Professional Rewrite current paragraph or selected text to be more professional
  • Library/AICore/AIPrompt/AI Split Task Split current todo into smaller manageable chunks.
  • Library/AICore/AIPrompt/AI Summarize Note Generate a summary of the current page.
  • Library/AICore/AIPrompt/AI Summarize Note - Chat Generate a summary of the current page using chat.
  • Library/AICore/New Page/AI New Chat Create a chat session with your LLM
  • Library/AICore/Widget/AI Chat On Page Adds a button to send the current page to an interactive AI chat session.

Included Space Script

  • Library/AICore/Space Script/AI Query LLM This space script allows you to use {{queryAI(userPrompt, systemPrompt)}} inside of a template. Note that these responses are not cached, so it’s recommended to either immediately bake the rendered template or only use it in a snippet that will be rendered into a note.
  • Library/AICore/Space Script/AI Search Embeddings This space script allows you to use {{searchEmbeddings(query)}} inside of a template. A string containing the results of the search is returned. Note that these responses are not cached, so it’s recommended to either immediately bake the rendered template or only use it in a snippet that will be rendered into a note.
  • Library/AICore/Space Script/Convert to bullets This space script allows takes a string and converts each line to a bullet item in a list, if it is not already.
  • Library/AICore/Space Script/Convert to task list This space script takes a string, and makes sure each line is a markdown task.
  • Library/AICore/Space Script/Indent lines This space script allows takes a string and indents each line one level, compared to the lineBefore.
  • Library/AICore/Space Script/Remove Duplicate Start This space script checks lineBefore against the first line of the response and deletes it if its a duplicate.